//
//  TaskAlertTableViewCell.m
//  HAODE
//
//  Created by LiYinDi on 15/12/30.
//  Copyright © 2015年 reabam.com. All rights reserved.
//

#import "TaskAlertTableViewCell.h"

@implementation TaskAlertTableViewCell

- (void)awakeFromNib {
  //  _dotLabel.layer.borderWidth= 1.0f;
    _dotLabel.layer.cornerRadius=5;
    _dotLabel.layer.masksToBounds = YES;
    [self setAutoLayout];
}
-(void)setAutoLayout
{
    [_dotLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(11);
        make.width.equalTo(@10);
        
        make.height.equalTo(@10);
        
        make.top.equalTo(self.mas_top).with.offset(24);
    }];
    [_numLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_dotLabel.mas_right).with.offset(5);
      //  make.right.equalTo(self.mas_right);
        
        make.height.equalTo(@18);
        
        make.centerY.equalTo(_dotLabel.mas_centerY);
    }];
    [_memberNameTag mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_numLabel.mas_left);
        make.width.equalTo(@30);
        
        make.height.equalTo(@17);
        
        make.top.equalTo(_numLabel.mas_bottom).with.offset(10);
    }];

    [_memberNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_memberNameTag.mas_right).with.offset(2);
        make.right.equalTo(_sourceTag.mas_left).with.offset(-10);
        
        make.height.equalTo(@17);
        
        make.centerY.equalTo(_memberNameTag.mas_centerY);
    }];
    
    [_sourceTag mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_memberNameLabel.mas_right).with.offset(3);
        make.width.equalTo(@30);
        
        make.height.equalTo(@15);
        
       make.centerY.equalTo(_memberNameTag.mas_centerY);
    }];
    
    [_sourceNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_sourceTag.mas_right).with.offset(2);
        make.right.equalTo(_timeTag.mas_left).with.offset(-10);
        
        make.height.equalTo(@15);
        
        make.centerY.equalTo(_memberNameTag.mas_centerY);
    }];
    [_timeTag mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_sourceNameLabel.mas_right).with.offset(10);
        make.width.equalTo(@30);
        
        make.height.equalTo(@15);
        
        make.centerY.equalTo(_memberNameTag.mas_centerY);
    }];

    [_timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_timeTag.mas_right).with.offset(2);
         make.right.equalTo(self.mas_right).priorityLow();
        
        make.height.equalTo(@15);
        
        make.centerY.equalTo(_memberNameTag.mas_centerY);
    }];
    
    [_purchaseTag mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_numLabel.mas_left);
        make.width.equalTo(@30);
        
        make.height.equalTo(@15);
        
        make.top.equalTo(_memberNameTag.mas_bottom) ;
    }];

    [_purchaseNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_purchaseTag.mas_right).with.offset(2);
        make.right.equalTo(_priceTag.mas_left).with.offset(-10);
        
        make.height.equalTo(@15);
        
        make.centerY.equalTo(_purchaseTag.mas_centerY);
    }];
    [_priceTag mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_purchaseNameLabel.mas_right).with.offset(10);
        make.width.equalTo(@40);
        
        make.height.equalTo(@20);
        
       make.centerY.equalTo(_purchaseTag.mas_centerY);
    }];
    
    [_priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_priceTag.mas_right).with.offset(1);
        make.right.equalTo(self.mas_right).with.offset(-10).with.priorityLow();
        
        make.height.equalTo(@20);
        
        make.centerY.equalTo(_purchaseTag.mas_centerY);
    }];
//    [_depositTag mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(_priceLabel.mas_right).with.offset(10);
//        make.width.equalTo(@70);
//        
//        make.height.equalTo(@20);
//        
//        make.centerY.equalTo(_purchaseTag.mas_centerY);
//    }];
//    
//    [_depositLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(_depositTag.mas_right).with.offset(1);
//        make.right.equalTo(self.mas_right).with.offset(-5).with.priorityLow();
//        
//        make.height.equalTo(@20);
//        
//        make.centerY.equalTo(_purchaseTag.mas_centerY);
//    }];

    [_lineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(10);
        make.right.equalTo(self.mas_right).with.offset(-10) ;
        
        make.height.equalTo(@1);
        
        make.bottom.equalTo(self.mas_bottom).with.offset(-1);
    }];

}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
